<!-- TRANSFERTS ENTRANTS -->
	<tr>
	    <td colspan="100"></td>
	</tr>
	<tr>
	    <td colspan="5" style="background: #95B3D7">Variable de paie du personnel entrant</td>
	    <td colspan='3' style="background: #95B3D7">Entrée/Sortie sur le Mois</td>
	    <td colspan='7' style="background: #95B3D7">Durée Hebdomadaire</td>
	    <td colspan='6' style="background: #95B3D7">Informations</td>
	    <td colspan='3' style="background: #95B3D7">Compteurs</td>
	    <td colspan='7' style="background: #95B3D7">Contrat Hebdomadaire</td>
	    <td colspan="5" style="background: #95B3D7">Taux Horaire brut</td>
	    <td rowspan="2" style="background: #95B3D7">Coef</td>
	    <td colspan="5" style="background: #95B3D7">Taux Horaire chargé</td>
	</tr>
	<tr>
	    <td style="background: #95B3D7">Mat.</td>
	    <td style="background: #95B3D7">Nom</td>
	    <td style="background: #95B3D7">Prénom</td>
	    <td style="background: #95B3D7">Poste</td>
	    <td style="background: #95B3D7">Contrat Horaire</td>
	    <!-- E/S Mois -->
	    <td style="background: #95B3D7">Entree</td>
	    <td style="background: #95B3D7">Sortie</td>
	    <td style="background: #95B3D7">Motif</td>
	    <!-- Durée hebdomadaire -->
	    <td style="background: #95B3D7">
		<a href="#" class="show-planning" data-site="<?php echo $post->site; ?>" data-periode="<?php echo $post->periode; ?>" data-semaine="1">S1</a>
	    </td>
	    <td style="background: #95B3D7">
		<a href="#" class="show-planning" data-site="<?php echo $post->site; ?>" data-periode="<?php echo $post->periode; ?>" data-semaine="2">S2</a>
	    </td>
	    <td style="background: #95B3D7">
		<a href="#" class="show-planning" data-site="<?php echo $post->site; ?>" data-periode="<?php echo $post->periode; ?>" data-semaine="3">S3</a>
	    </td>
	    <td style="background: #95B3D7">
		<a href="#" class="show-planning" data-site="<?php echo $post->site; ?>" data-periode="<?php echo $post->periode; ?>" data-semaine="4">S4</a>
	    </td>
	    <td style="background: #95B3D7">
		<a href="#" class="show-planning" data-site="<?php echo $post->site; ?>" data-periode="<?php echo $post->periode; ?>" data-semaine="5">S5</a>
	    </td>
	    <td style="background: #95B3D7">
		Total
	    </td>		
	    <td style="background: #95B3D7">Moyenne</td>
	    <!-- Informations -->
	    <td style="background: #95B3D7">CP</td>
	    <td style="background: #95B3D7">CSS</td>
	    <td style="background: #95B3D7">AM1</td>
	    <td style="background: #95B3D7">AM2</td>
	    <td style="background: #95B3D7">AT</td>
	    <td style="background: #95B3D7">ABS</td>
	    <!-- Compteur -->
	    <td style="background: #95B3D7">Retard</td>
	    <td style="background: #95B3D7">Heures Planifiées</td>
	    <td style="background: #95B3D7">Résultat</td>
	    <!-- Contrat Hebdomadaire -->
	    <td style="background: #95B3D7">S1</td>
	    <td style="background: #95B3D7">S2</td>
	    <td style="background: #95B3D7">S3</td>
	    <td style="background: #95B3D7">S4</td>
	    <td style="background: #95B3D7">S5</td>
	    <td style="background: #95B3D7">Total</td>
	    <td style="background: #95B3D7">Moyenne</td>
	    <td style="background: #95B3D7">S1</td>
	    <td style="background: #95B3D7">S2</td>
	    <td style="background: #95B3D7">S3</td>
	    <td style="background: #95B3D7">S4</td>
	    <td style="background: #95B3D7">S5</td>
	    <!-- Coef -->
	    <td style="background: #95B3D7">S1</td>
	    <td style="background: #95B3D7">S2</td>
	    <td style="background: #95B3D7">S3</td>
	    <td style="background: #95B3D7">S4</td>
	    <td style="background: #95B3D7">S5</td>
	</tr>
	<?php
	$transferts	 = $this->transferts;
	$dataTransfert	 = array();
	foreach ($transferts as $entrants) {
	    $data = array(
		'employe'	 => null,
		'semaines'	 => array(1 => new RHDateTime(), new RHDateTime(), new RHDateTime(), new RHDateTime(), new RHDateTime()),
		'values'	 => array(1 => 0.0, 0.0, 0.0, 0.0),
	    );
	    foreach ($data['semaines'] as $heure) {
		$heure->setTime();
	    }
	    foreach ($entrants as $entrant) {
		$employe	 = $entrant->getEmploye();
		$number		 = $manager->getSemaineNumber($entrant->journee);
		$value		 = $manager->calculateOneDayTransfert($entrant);
		$data['employe'] = $employe;
		if (isset($data['semaines'][$number])) {
		    $data['semaines'][$number]->addHours($value->tempsDiff, false);
		    $data['values'][$number] += $value->montant;
		}
	    }
	    $dataTransfert[] = $data;
	}
	?>
	<?php $jaune = 1; ?>
	<?php foreach ($dataTransfert as $t): ?>
	    <?php
	    $employe = $t['employe'];
	    $poste	 = $employe->getPoste();
	    $colorJaune	 = (($jaune % 2) == 0) ? '#FFEE05' : '#FFF67F';
	    ?>
    	<tr>
    	    <td style='background: <?php echo $colorJaune; ?>'><?php echo $employe->getMatricule(true); ?></td>
    	    <td style='background: <?php echo $colorJaune; ?>'>
		<a href="<?php echo $this->url('RHX/default', array('controller' => 'employe', 'action' => 'edit', 'id' => $employe->matricule)) ?>" target="_blank"><?php echo $employe->nom1; ?></a>
	    </td>
    	    <td style='background: <?php echo $colorJaune; ?>'>
		<a href="<?php echo $this->url('RHX/default', array('controller' => 'employe', 'action' => 'edit', 'id' => $employe->matricule)) ?>" target="_blank"><?php echo $employe->prenom; ?></a>
	    </td>
    	    <td style='background: <?php echo $colorJaune; ?>'><?php echo $poste->code; ?></td>
    	    <td style='background: <?php echo $colorJaune; ?>'><?php echo $employe->getHoraireHebdo(true); ?></td>
    	    <!-- Entrée  et sortie sur le mois -->
		<?php
		$entree	 = ($manager->isEntreeMonth($employe, $periode)) ? $employe->contrat_debut : '';
		$sortie	 = ($manager->isSortieMonth($employe, $periode)) ? $employe->contrat_fin : '';
		?>
    	    <td>
		    <?php
		    if ($entree != '') {
			$entree = new RHDateTime($entree);
			echo $entree->date('d/m/Y');
		    }
		    ?>
    	    </td>
    	    <td>
		    <?php
		    if ($sortie != '') {
			$sortie = new RHDateTime($sortie);
			echo $sortie->date('d/m/Y');
		    }
		    ?>
    	    </td>
    	    <td>
		    <?php
		    if ($entree != '') {
			echo 'Embauche';
		    }
		    if ($sortie != '') {
			try {
			    $motif = $employe->getMotif();
			    echo '<br>' . $motif->libelle;
			}
			catch (Exception $ex) {
			    echo '<br>Aucun';
			}
		    }
		    ?>
    	    </td>
	    <!-- Durée Hebdomadaire -->
	    <?php 
	    $semaine = $t['semaines']; 
	    $count = 0;
	    $total = 0.0;
	    ?>
	    <?php for($i = 1; $i < 6; $i++): ?>
	    <?php
	    if(RHDateTime::toFloat($semaine[$i]->totalHours()) > 0.0){
		$count++;
		$total += RHDateTime::toFloat($semaine[$i]->totalHours());
	    }
	    ?>
	    <td>
		<?php echo Number::frenchFormat(RHDateTime::toFloat($semaine[$i]->totalHours())); ?>
	    </td>
	    <?php endfor; ?>
	    <td>
		<?php echo '' ?>
	    </td>
	    <td style='background: <?php echo $colorJaune; ?>'>
		<b><?php echo Number::frenchFormat($total / $count); ?></b>
	    </td>
	    <!-- Information -->
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <!-- Compteur -->
	    <td></td>
	    <td></td>
	    <td></td>
	    <!-- Contrat Hebdomadaire -->
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <!-- Taux horaire -->
	    <?php $cpData = $employe->getDataCP(); ?>
	    <td><?php echo Number::frenchFormat($cpData['taux']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux']); ?></td>
	    <td><?php echo 0.0; ?></td>
	    <!-- Coefficient -->
	    <td style='background: <?php echo $colorJaune; ?>'><?php echo Number::frenchFormat($cpData['coef']); ?></td>
	    <!-- Taux horaire -->
	    <td><?php echo Number::frenchFormat($cpData['taux'] * $cpData['coef']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux'] * $cpData['coef']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux'] * $cpData['coef']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux'] * $cpData['coef']); ?></td>
	    <td><?php echo Number::frenchFormat($cpData['taux'] * $cpData['coef']); ?></td>
    	</tr>
	<?php $jaune++; ?>
	<?php endforeach; ?>